
/****
 * Copyright (C) 2006 dNux Team      
 *                                                            ****
 * This program is free software; you can redistribute it and/or *
 * modify under the terms of the GNU General Public License as   *
 * published by the Free Software Foundation;                    *
 * either version 2 of the License.                              *
 *                                                               *
 * This program is distributed in the hope that it will be       *
 * useful, but WITHOUT ANY WARRANTY; without even the implied    *
 * warranty of without even the implied waranty of               *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.          *
 * See the GNU General Public License for more details.          *
 *                                                               *
 * You should have received a copy of the                        *
 * GNU General Public License                                    *
 * along with this program; if not, write to the                 *
 * Free Software Foundation, Inc.,                               *
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. *
 *                                                               *
 ****                                                         ****/

#ifndef __DHASH_H__
#define __DHASH_H__

#include <dcore.h>

typedef struct _d_hash_s d_hash_t;

void      d_hash_init();

d_hash_t *d_hash_new(d_error_t **error);
void      d_hash_free(d_hash_t **hash);

void      d_hash_add_file(d_hash_t *hash, char *file);
void      d_hash_add_reference(d_hash_t *hash, char *file, char *digest, char *value);

d_bool_t  d_hash_check(d_hash_t *hash, d_error_t **error);

void      d_hash_display(d_hash_t *hash);
void      d_hash_display_files(d_hash_t *hash);
void      d_hash_display_references(d_hash_t *hash);
void      d_hash_display_diff(d_hash_t *hash);
void      d_hash_display_result(d_hash_t *hash);
void      d_hash_display_result_xml(d_hash_t *hash);

d_map_t  *d_hash_get_result(d_hash_t *hash);

void      d_hash_set_files(d_hash_t *hash, d_list_t *files);
void      d_hash_set_references(d_hash_t *hash, d_map_t *references);

void      d_hash_perform_references(d_hash_t *hash, d_error_t **error);

void      d_hash_perform_digest(d_hash_t *hash, char *digest,
				d_error_t **error);

void      d_hash_perform_digest_file(d_hash_t *hash, char *file, char *digest,
				     d_error_t **error);

void      d_hash_result_add(d_hash_t *hash, char *file, char *digest,
			    char *value);

void      d_hash_result_save(d_hash_t *hash, char *file, d_error_t **error);

void      d_hash_references_load(d_hash_t *hash, char *file,
				 d_error_t **error);

#endif /* __DHASH_H_ */

